package cn.gdchent.springbootsecurity.mapper;

import cn.gdchent.springbootsecurity.enity.UserInfoDetails;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @auther:gdchent
 * @create:2020/4/13 16:10
 * @Description:
 */
@Mapper
public interface UserMapper {
    @Select("select * from user_info where user_name=#{user_name}")
    UserInfoDetails findByUserName(@Param("user_name") String user_name); //通过用户名查找用户

    @Insert("insert into user_info(user_id,user_name,password,roles) values(#{user_id},#{user_name},#{password},#{roles})")
    Integer insertUser(@Param("user_id") String user_id,@Param("user_name") String user_name,@Param("password") String password,@Param("roles") String roles);
}
